﻿<%@ Control Language="VB" AutoEventWireup="false" CodeFile="PrintListNew.ascx.vb" Inherits="Control_Customer_PrintListNew" %>

	<script type='text/javascript'>
	    function ajaxJquery() {
	        $(function () {
	            $("#<%= btnPrint.ClientID %>").click(function () {
	                var _fDate = "?fDate=" + $("#<%= txtFromDate.ClientID %>").val();
	                var _tDate = "&tDate=" + $("#<%= txtToDate.ClientID %>").val();
	                var _cus = "&cus=" + $("#<%= txtCustomerName.ClientID %>").val();
	                var _pass = "&passport=" + $("#<%= txtPassportNumber.ClientID %>").val();
	                var _country = "&country=" + $("#<%= ddlCountryCode.ClientID %>").val();
	                var _hc = "&hc=" + $("#<%= txtPassportNumber.ClientID %>").val();
	                printPreview("in-danh-sach.html" + _fDate + _tDate + _cus + _country + _hc);
                    
	            });
                 
	            $(".Date").datepicker({ dateFormat: 'dd/mm/yy' });
	            var url = '<%= ConfigurationManager.AppSettings("MainDomain") %>';

	            $(".SubjectTitle input, .SubjectTitle select").keypress(function (e) {
	                if (e.keyCode == 13) {
	                    $("#<%=btnFilter.ClientID()%>").click();
	                    return false;
	                }
	            });

	            //check cookie to show or hide search pannel
	            if ($.cookie('CookieSiteSearch') == 1) {
	                $('#pnlSearch').show();
	                $('#imgShowHide').attr("src", url + "images/arrow_popup.gif");
	            }
	            else {
	                $('#pnlSearch').hide();
	                $('#imgShowHide').attr("src", url + "images/arrow_showless.gif");
	            }


	            $('#B1').click(function (event) {

	                //set cookie
	                if ($.cookie('CookieSiteSearch') == 1) {
	                    $.cookie('CookieSiteSearch', 0)
	                }
	                else {
	                    $.cookie('CookieSiteSearch', 1)
	                }
	                $('#pnlSearch').slideToggle(500);
	                if ($('#imgShowHide').attr("src") == url + "images/arrow_popup.gif") {
	                    $('#imgShowHide').attr("src", url + "images/arrow_showless.gif");
	                }
	                else {
	                    $('#imgShowHide').attr("src", url + "images/arrow_popup.gif");
	                }
	            });

	        });

	    }

	    function printPreview(url) {
	        var iwin;
	        iwin = window.open(url, 'CustomPopUp', 'width=' + screen.width + ', height=' + screen.height + ', menubar=yes, resizable=yes, alight=center, location=yes, top=130, left=230, titlebar=yes, scrollbars=yes');
	        iwin.focus();
	    }

    </script>
<asp:UpdatePanel ID="uplCustomerPrintList" runat="server">
<ContentTemplate>
	
	<div class="HeadTitle"><h3>DANH SÁCH IN</h3></div>

        <div class="SubjectTitle" id="SInfor" runat="server">
            <legend class="SubjectTitle">
                <img alt="" src="" id="imgShowHide" />
                <a id="B1" href="#">Tìm kiếm </a>&nbsp;&nbsp;</legend>
        </div>
              

         <div id="pnlSearch" class="SubjectTitle">

            <div>
                    <div class="DivLeft">
                        <asp:Label ID="Label1" CssClass="TextLabel" runat="server" Text="Tên khách Hàng:" />
                    </div>
                    <div class="DivRight">
                        <asp:TextBox ID="txtCustomerName" CssClass="TextBox" runat="server" Text="" />
                    </div>
            </div>


            

            <div>
                    <div class="DivLeft">
                            <asp:Label ID="lblDescription" CssClass="TextLabel" runat="server" Text="Ngày check in:" />
                    </div>
                    <div class="DivRight">
                         <asp:TextBox ID="txtFromDate" CssClass="TextBox Date" runat="server" Text="" /> <i>(dd/MM/yyyy)</i>
                    </div>
            </div>

            <div>
                    <div class="DivLeft">
                            <asp:Label ID="Label2" CssClass="TextLabel" runat="server" Text="Ngày check out:" />
                    </div>
                    <div class="DivRight">
                         <asp:TextBox ID="txtToDate" CssClass="TextBox Date" runat="server" Text="" /> <i>(dd/MM/yyyy)</i>
                    </div>
            </div>


            <div>
                    <div class="DivLeft">
                            <asp:Label ID="lblAddress1" CssClass="TextLabel" runat="server" Text="Số hộ chiếu:" />
                    </div>
                    <div class="DivRight">
                        <asp:TextBox ID="txtPassportNumber" CssClass="TextBox" runat="server" Text="" />
                    </div>
            </div>

            <div class="QuocTich">
                    <div class="DivLeft">
                              <asp:Label ID="lblAddress2" CssClass="TextLabel" runat="server" Text="Quốc tịch:" />
                    </div>
                    <div class="DivRight">
                         <asp:DropDownList ID="ddlCountryCode" CssClass="DropDownList" runat="server" />
                    </div>
            </div>

            

            


             <div>
                    <div class="DivLeft">&nbsp;
                    </div>
                    <div class="DivRight">
                        <asp:Button ID="btnFilter" runat="server" Text='Tìm kiếm' CssClass='btn' />
                        <asp:Button ID="bnReset" runat="server" Text='Đặt lại' CssClass='btn' />
                    </div>
             </div>

         </div>





	<asp:GridView ID="grdShow" runat="server" AutoGenerateColumns="False" EmptyDataText="{Không có dữ liệu}"
		   AllowPaging="false"   Width='100%' BorderWidth="1px" CssClass="GridBorder">
		    <Columns>
		
	
	<asp:TemplateField HeaderText="Stt">
		  <ItemTemplate>
			    <asp:Label runat="server" ID="lblSTT" Text=''></asp:Label>
	        </ItemTemplate>
		  <ItemStyle Width="4%"  HorizontalAlign="Left" />
	</asp:TemplateField>
		 <asp:TemplateField HeaderText='Họ và tên'>
		  <ItemTemplate>
			    <asp:HyperLink ID="hplFullname" runat="server"></asp:HyperLink>
		 </ItemTemplate>
		 <ItemStyle Width='12%' CssClass='text_list_links' HorizontalAlign='Left' />
		</asp:TemplateField>
        <asp:BoundField DataField='DateOfBirth' HeaderText='Ngày sinh' DataFormatString="{0:dd/MM/yyyy}">
			 <ItemStyle  Width='10%' />
		 </asp:BoundField>

		 <asp:BoundField DataField='CountryName' HeaderText='Quốc tịch'>
			 <ItemStyle  Width='8%' />
		 </asp:BoundField>

		 <asp:BoundField DataField='PasspostNumber' HeaderText='Số hộ chiếu'>
			 <ItemStyle  Width='10%' />
		 </asp:BoundField>
		 <asp:BoundField DataField='FromDate' HeaderText='Tạm trú từ ngày' DataFormatString="{0:dd/MM/yyyy}">
			 <ItemStyle  Width='12%' />
		 </asp:BoundField>
		 <asp:BoundField DataField='ToDate' HeaderText='Tạm trú đến ngày' DataFormatString="{0:dd/MM/yyyy}">
			 <ItemStyle  Width='12%' />
		 </asp:BoundField>

		 <asp:BoundField DataField='Created' HeaderText='Ngày nhập' DataFormatString="{0:dd/MM/yyyy HH:mm}">
			 <ItemStyle  Width='10%' />
		 </asp:BoundField>

		 <asp:BoundField DataField='CheckOutDate' HeaderText='Check out' DataFormatString="{0:dd/MM/yyyy}">
			 <ItemStyle  Width='10%' />
		 </asp:BoundField>

	</Columns>
	 <HeaderStyle Height="26px" HorizontalAlign="Left" CssClass="GridHeader" />
	 <RowStyle CssClass="GridRow" Height="23px" />
	 <AlternatingRowStyle CssClass="GridAlterRow" />
	 <PagerStyle CssClass="GridPaged" HorizontalAlign="Right" Height="23px" />
	 <PagerSettings Mode="Numeric" PageButtonCount="2" />
	 <EmptyDataRowStyle CssClass="GridTextEmpty" HorizontalAlign="Center" />
	</asp:GridView>
	<div>
            
             <asp:Label ID="lblPage_Size" runat="server" Text="Số bản ghi trên trang:" ></asp:Label>		
              <asp:DropDownList ID="drpPage_Size" runat="server" AutoPostBack="True" Width="70px" CssClass="input_form">
		 <asp:ListItem Text="10" Value="10"></asp:ListItem>
		 <asp:ListItem Text="20" Value="20"></asp:ListItem>
		 <asp:ListItem Text="50" Value="50"></asp:ListItem>
		 <asp:ListItem Text="100" Value="100"></asp:ListItem>
		 </asp:DropDownList>
		  <asp:Label ID="lblTotal" runat="server"></asp:Label></div>
	<div style="width: 99%">
		 <!--phan trang-->
		 <div id="results_resultsNavigationDiv" class="paginationEMP">
		 <ul>
		     <asp:LinkButton ID="lnkFirst" runat="server"></asp:LinkButton>
		     <asp:Repeater ID="rptPage" runat="server">
		         <ItemTemplate>
		              <asp:LinkButton ID="lnkTitle" CssClass="page_num" runat="server" OnClick="lnkTitle_Click"></asp:LinkButton>
		         </ItemTemplate>
		    </asp:Repeater>
		    <asp:LinkButton ID="lnkLast" runat="server"></asp:LinkButton>
		     
		   </ul>
		  </div>
		  <asp:HiddenField ID="hidCount" Value="0" runat="server" />
		 <asp:HiddenField ID="hidIndex_page" Value="0" runat="server" />
		 <asp:HiddenField ID="hidCur_Page" Value="1" runat="server" />
		  </div>
    <br/>
     <div>Chú ý: Khi in vui lòng chọn kiểu Landscape (in khổ giấy ngang)</div>

    <div>
        <asp:Button ID="btnPrint" runat="server" Text="In danh sách" CssClass="btn_long" Enabled="false"/>
    </div>

	<div style='display: none'>
	<asp:DropDownList ID="drpMessage" runat="server" >
		  <asp:ListItem Text='Bạn có chắc chắn muốn xóa bản ghi này không?' Value='0'></asp:ListItem>
		   <asp:ListItem Text='Bạn có chắc chắn muốn xóa bản đã chọn?' Value='1'></asp:ListItem>
	 <asp:ListItem Text='Bạn phải chọn ít nhất một bản ghi.' Value='2'></asp:ListItem>
	</asp:DropDownList>
	 <asp:HiddenField ID="hidID" Value="0" runat="server" />
	</div>

</ContentTemplate>
</asp:UpdatePanel>
